package com.example.myapplication;

import android.view.View;
import android.widget.TextView;

import com.alibaba.android.arouter.launcher.ARouter;
import com.example.base.base.base1.BaseActivity;
import com.example.base.utils.LogUtil;
import com.example.network_lib.module.UpdateAppBean;
import com.vector.update_app.debug.HttpUtils;

import butterknife.BindView;

/**
 * @author Administrator
 */
public class MainActivity extends BaseActivity<MainPresenter> implements IMainContractView.View, View.OnClickListener {
    @BindView(R.id.tv_status)
    TextView mTvStatus;

    @BindView(R.id.tv_order)
    TextView mTvOrder;


    @Override
    public void initPresenter() {
        mPresenter.init(this);
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_main;
    }


    @Override
    public void loadData() {
        HttpUtils.updateDiy(this, Constant.getAppVersion);
        mPresenter.getMainData();
        mTvOrder.setOnClickListener(this);
    }


    @Override
    public void getMainDataSuccess(UpdateAppBean result) {
        LogUtil.d(result.toString());
    }

    @Override
    public void showLoadingView(String content) {

    }

    @Override
    public void StopLoadingView() {

    }

    @Override
    public void showErrorMsg(String errMsg, String type) {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_order:
                ARouter.getInstance().build("/activity/orderDetail").navigation();
                break;
            default:
                break;
        }
    }
}
